// 操作数据库
const mongoose = require('mongoose')

// 定义文档结构 => 生成Schema对象 创建当前数据库某个集合的约束对象
const bookSchema = mongoose.Schema({
  name: String,
  author: String,
  price:Number 
})

// 生成Model
const BookModel = mongoose.model('books', bookSchema)

//导出BookModel
module.exports = BookModel
